<template>
	<view>
		<uni-card class="header">
			<!-- 退款原因 -->
			<view class="reason">
				<text>{{list.reasonForRefund == 1 ?'摄影师拒绝接单，已退款成功':`平台退款${list.platformRefund},已退款成功`}}</text>
				<text>￥{{list.price}}</text>
			</view>
			<!-- 退款时间 -->
			<view class="refundTime">
				<text>{{refundTime1}}</text>
			</view>
			<!-- 退款去路 -->
			<view class="refundRouting">
				<text>{{list.refundRouting == 1 ?`退回银行卡(${list.refundRouting})`:`退回支付宝(${list.refundRouting})`}}</text>
				<text>￥{{list.price}}</text>
			</view>
		</uni-card>
		<!-- 退款信息 -->
		<uni-card class="info" title="退款信息">
			<view class="" style="margin-bottom: 15rpx;">
				<view class="left">
					<view class="avatar">
						<u--image :src="list.imgUrl" width="150rpx" height="150rpx"></u--image>
					</view>
					<view class="more">
						<view class="name">
							{{list.shopName}}

							<view class="u-demo-block" style="margin-left: 10rpx;">
								<view class="u-demo-block__content">
									<view class="u-page__tag-item">
										<u-tag size="mini" :text="list.orderType" v-if="list.orderType == '本片约拍'">
										</u-tag>
										<u-tag size="mini" :text="list.orderType" type="success" v-else>
										</u-tag>
									</view>

								</view>
							</view>

						</view>
						<view class="style">
							{{list.orderStyle}}
						</view>
						<view class="time">
							{{orderTime}}
						</view>
					</view>
				</view>
			</view>
			<!-- 退款原因 -->
			<view class="reason">
				<text>退款原因：</text>
				<text>{{list.reasonForRefund == 1 ?'摄影师拒绝接单':`平台退款${list.platformRefund}`}}</text>
			</view>

			<view class="price">
				<text style="color: #000;
			font-weight: 900;">退款金额：</text>
				<text>￥{{list.price}}</text>
			</view>
			<!-- 退款时间 -->
			<view class="refundTime">
				<text style="color: #000;
			font-weight: 900;">退款时间：</text>
				<text>{{refundTime2}}</text>
			</view>
		</uni-card>
	</view>
</template>

<script>
	import {
		formatTime
	} from '../../utils/formatTime.js'
	export default {
		data() {
			return {
				list: {
					// 退款原因  1为摄影师拒绝接单  2为平台退款（摄影师态度恶劣  拍摄质量粗糙）
					reasonForRefund: '1',
					// 平台退款原因
					platformRefund: '摄影师态度恶劣',
					// 退款时间
					refundTime: 1777888999,
					// 退款方式
					refundRoutingType: 1,
					// 退款去路
					refundRouting: '中国工商银行尾号7889',
					// 退款金额
					price: '31.80',
					// 退款商品图片
					imgUrl: 'https://cdn.uviewui.com/uview/album/1.jpg',
					// 商家名称
					shopName: '小黄约拍',
					// 类型
					orderType: '自主约拍',
					// 下单时间
					orderTime: 1777777777,
					// 订单风格
					orderStyle: '写真/古风/千金园林风'
				}

			};
		},
		computed: {
			refundTime1() {
				return formatTime(this.list.refundTime, 7)
			},
			refundTime2() {
				return formatTime(this.list.refundTime, 1)
			},
			orderTime() {
				return formatTime(this.list.orderTime, 2)
			}
		}
	}
</script>

<style lang="scss">
	.header {

		.reason {
			display: flex;
			justify-content: space-between;
			color: red;
			font-weight: 900;
			margin-bottom: 10rpx;
		}

		.refundRouting {
			display: flex;
			justify-content: space-between;
			font-weight: 900;
			color: #000;
			margin-top: 10rpx;
		}
	}

	.info {
		.left {
			display: flex;
			align-items: center;

			.avatar {
				margin-right: 20rpx;
			}

			.more {
				.name {
					display: flex;
					align-items: center;
					font-size: $uni-font-size-lg;
					font-weight: 900;
					margin-bottom: 10rpx;
				}
			}
		}

		.reason {
			display: flex;
			justify-content: space-between;
			color: #000;
			font-weight: 900;
			margin-bottom: 10rpx;
			margin-top: 40rpx;
		}

		.price {
			display: flex;
			justify-content: space-between;

			margin-bottom: 10rpx;
		}

		.refundTime {
			display: flex;
			justify-content: space-between;

			margin-bottom: 10rpx;
		}
	}
</style>